﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;


namespace StudentStatistics
{
    /// <summary>
    /// QuestionNumberControl1.xaml 的交互逻辑
    /// </summary>
    public partial class QuestionNumberControl : UserControl
    {

        public ObservableCollection<string> QuestionButtonIteams
        {
            get { return (ObservableCollection<string>)GetValue(QuestionButtonIteamsProperty); }
            set { SetValue(QuestionButtonIteamsProperty, value); }
        }
        public static readonly DependencyProperty QuestionButtonIteamsProperty =
            DependencyProperty.Register("QuestionButtonIteams", typeof(ObservableCollection<string>), typeof(QuestionNumberControl), new PropertyMetadata(new ObservableCollection<string>()));

        public ObservableCollection<string> OderIteam = new ObservableCollection<string>();

        int a = 31;

        public QuestionNumberControl()
        {
            InitializeComponent();

            for (int i = 1; i < a; i++)
            {
                this.OderIteam.Add(i.ToString());
            }
            OderIteam = new ObservableCollection<string>(OderIteam.ToList());
            this.QuestionButtonIteams = this.OderIteam;
            this.Loaded += QuestionNumberControl_Loaded;
        }

        void QuestionNumberControl_Loaded(object sender, RoutedEventArgs e)
        {
            //this.QuestionButtonIteams.Clear();
            //for (int i = 1; i < a; i++)
            //{
            //    this.QuestionButtonIteams.Add(i.ToString());
            //}
            //QuestionButtonIteams = new ObservableCollection<string>(OderIteam.Take(10).ToList());

        }
    }
}
